package mall.core.jdbc;

import com.zaxxer.hikari.HikariDataSource;
import mall.core.ApplicationProperties;
import org.springframework.jdbc.core.JdbcTemplate;

/**
 * @author xf07b1
 * @wechat xf07b1
 */
public class Repository {
    protected static JdbcTemplate jdbcTemplate;

    static  {
        HikariDataSource dataSource = new HikariDataSource();
        dataSource.setDriverClassName(ApplicationProperties.JDBC_DRIVER);
        dataSource.setJdbcUrl(ApplicationProperties.JDBC_URL);
        dataSource.setUsername(ApplicationProperties.JDBC_USERNAME);
        dataSource.setPassword(ApplicationProperties.JDBC_PASSWORD);
        jdbcTemplate = new JdbcTemplate(dataSource);
    }

}
